<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;
//微信服务器配置接口
Route::any('test','api/v2.Pay/test');

Route::group('api/:version',function(){
    //Banner首页接口
    Route::get('banner/:id','api/:version.Banner/getBanner');
    //获取专题栏目
    Route::get('special/getspecial','api/:version.Special/getSpecialColumn');
    //通过专题栏目获取文章标题
    Route::get('special/gettitle/:id','api/:version.Special/getSpecialTitle');
    //通过文章ID获取文章内容
    Route::get('special/getcontent/:id','api/:version.Special/getContentByID');


    //发送code获取token
    Route::post('token/user','api/:version.Token/getToken');
    //验证token是否有效
    Route::post('token/verify','api/:version.Token/verifyToken');
    //授权获取用户信息
    Route::post('user/getinfo','api/:version.User/getUserInfo');
    //获取用户资料
    Route::post('user/getuser','api/:version.User/getUser');
    //获取用户手机号
    Route::post('user/gettel','api/:version.User/getTel');


    //付款前初始页面，获取优惠劵及积分信息，以及后台是否开启
    Route::get('pay/facepay','api/:version.Pay/facePay');

    //价格处理接口    order：为菜品下单 face为当面付
    Route::post('pay/handle_price/:order_type','api/:version.Pay/handlePrice');
//    Route::post('order/handle_price','api/:version.Order/handlePrice');

    //商品下单
    Route::post('pay/order_pay','api/:version.Pay/orderPay');
//    Route::post('order/order_pay','api/:version.Order/orderPay');

    //订单号支付
    Route::get('pay/order_sn/:sn','api/:version.Pay/snPay');

    //支付后的异步处理
    Route::post('pay/notify','api/:version.Pay/payNotify');

    //充值接口
    Route::post('pay/deposit','api/:version.Pay/deposit');
    //充值回调
    Route::post('pay/deposit_notify','api/:version.Pay/depositNotify');

    Route::get('pay/deposit_rule','api/:version.Deposit/depositRule');

    //当面付请求支付
//    Route::post('pay/faceorder','api/:version.Pay/facePayOrder');
});

Route::group('api/:version',function(){
    //预约列表
    Route::get('appointment/getlist','api/:version.Appointment/getAppointmentList');
    //取消预约
    Route::post('appointment/cancel','api/:version.Appointment/cancelAppointment');
    //预约详情
    Route::get('appointment/getinfo/:id','api/:version.Appointment/getInfo');
    //创建新预约
    Route::post('appointment/create','api/:version.Appointment/createAppointment');
    //评论列表
    Route::get('comment/getlist','api/:version.Comment/getCommentList');
    //评论图片上传
    Route::post('comment/upload','api/:version.Comment/createCommentImage');
    //添加订单评论
    Route::post('comment/add','api/:version.Comment/createComment');

    //订单列表
    Route::get('order/getlist/:status','api/:version.Order/getOrderList');
    //订单详情
    Route::get('order/getinfo/:id','api/:version.Order/getOrderInfo');
    //未支付取消订单
    Route::post('order/close','api/:version.Order/closeOrder');
    //申请退单
    Route::post('order/refund','api/:version.Order/refund');
    //我的优惠券
    Route::get('coupon/list','api/:version.Coupon/getMyCoupon');

    //用户确认订单
    Route::get('order/confirmOrder','api/:version.Order/confirmOrder');
    //我的积分账单
    Route::get('pointsbill','api/:version.PointsBill/getMyPointsBill');
    //店铺信息
    Route::get('getshopinfo','api/:version.ShopInfo/getInfo');
});

//首页的菜品推荐
Route::get('api/:version/getHomePageRecommend','api/:version.Goods/getRecommendForIndex');
//点餐页的分类及商品
Route::get('api/:version/getGoodsAll','api/:version.Goods/getGoodsAll');
//无搜索条件 进入搜索页
Route::get('api/:version/getNoSearch','api/:version.Goods/getNoSearchResult');
//有搜索条搜索
Route::post('api/:version/getGoodsSearch','api/:version.Goods/getGoodsSearch');
//有规格的的商品获取商品的规格,及默认的商品价格
Route::get('api/:version/getGoodsSpec/:id','api/:version.Goods/getGoodsSpec');
//获取单个商品的详情
Route::get('api/:version/getGoodsDetails/:id','api/:version.Goods/getGoodsDetails');
//获取带有规格的商品的价格
Route::get('api/:version/getGoodsSpecPrice','api/:version.Goods/getGoodsSpecPrice');


//首页(免费领取优惠券的活动)此处为最新的互动
//Route::get('api/:version/getNewActivity','api/:version.Activity/getNewActivity');
Route::get('api/:version/getNewActivity','api/:version.Activity/getActivity');
//根据活动的id优惠券的话则返回优惠券的信息,
Route::get('api/:version/getCoupons/:id','api/:version.Activity/getCoupons');
//获取新人专享活动
//Route::get('api/:version/getNewPersonActivity','api/:version.Activity/getForPeopleActivity');
//获取所有的活动的列表
//Route::get('api/:version/getAllActivity','api/:version.Activity/getAllActivity');
//获取某个活动的详情介绍
//Route::get('api/:version/getActivityDetails/:id','api/:version.Activity/getActivityDetails');
//活动发放优惠券的接口
Route::post('api/:version/getCoupon','api/:version.CouponReceipt/index');


Route::get('api/:version/getCollage','api/:version.Collage/getCollage');

Route::get('api/:version/getCollageDetails/:id','api/:version.Collage/getCollageDetails');

Route::get('api/:version/getUserAllInfo','api/:version.User/getUserAllInfo');


